package estore.service;

import estore.model.Product;
import java.util.Comparator;

public class ProductSorters {
    public static final Comparator<Product> BY_PRICE_ASC = Comparator.comparingDouble(Product::getPrice);
    public static final Comparator<Product> BY_PRICE_DESC = BY_PRICE_ASC.reversed();
    public static final Comparator<Product> BY_STOCK_DESC = Comparator.comparingInt(Product::getStock).reversed();
}